package game.games.rpg.magic;

import game.games.rpg.Player;


public class AutoHealthBuff extends AbstractBuff
{
    private Player player;

    public AutoHealthBuff(Player player)
    {
        super(Integer.MAX_VALUE, 0, 10);
        this.player = player;
    }

    @Override
    protected void doIt()
    {
        int health = player.getHealth() + 6;
        if (health > player.getMaxHealth())
        {
            health = player.getMaxHealth();
        }
        player.setHealth(health);
    }
}
